const {
  DataTypes
} = require('sequelize');

module.exports = sequelize => {
  const attributes = {
    cate_id: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
      defaultValue: null,
      primaryKey: true,
      autoIncrement: true,
      comment: "主键user_id",
      field: "cate_id",
      unique: "cate_id"
    },
    cate_name: {
      type: DataTypes.STRING(32),
      allowNull: false,
      defaultValue: null,
      primaryKey: false,
      autoIncrement: false,
      comment: "分类名",
      field: "cate_name",
      unique: "cate_name"
    },
    creation_time: {
      type: DataTypes.DATE,
      allowNull: true,
      defaultValue: sequelize.literal('CURRENT_TIMESTAMP'),
      primaryKey: false,
      autoIncrement: false,
      comment: "创建时间",
      field: "creation_time"
    },
    update_time: {
      type: DataTypes.DATE,
      allowNull: true,
      defaultValue: sequelize.literal('CURRENT_TIMESTAMP'),
      primaryKey: false,
      autoIncrement: false,
      comment: "最近一次修改时间",
      field: "update_time"
    },
    is_delete: {
      type: DataTypes.INTEGER(1),
      allowNull: true,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "是否删除",
      field: "is_delete"
    }
  };
  const options = {
    tableName: "project_cates",
    comment: "",
    indexes: []
  };
  const ProjectCatesModel = sequelize.define("project_cates_model", attributes, options);
  return ProjectCatesModel;
};